package com.itsv.cyzx.adapter;

import java.util.ArrayList;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.itsv.cyzx.util.AsyncImageLoader;
import com.itsv.xhyy.R;

public class ImageExamine_Adapter extends BaseAdapter {
	private ArrayList<String> list;
	private Context context;

	public ImageExamine_Adapter(ArrayList<String> list, Context context) {
		this.list = list;
		this.context = context;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ImageView holder = null;
		if (convertView == null) {
			holder = new ImageView(context);
			holder.setImageResource(R.drawable.image_icon);
			convertView = holder;
			convertView.setTag(holder);
		} else {
			holder = (ImageView) convertView.getTag();
		}
		String url = list.get(position);
		AsyncImageLoader.getInstance().DisplayImage(url, holder);
		return convertView;
	}

}
